package com.hnevc.car;

public class Car {
	
	private int x;//X坐标
	private int y;//Y坐标
	
	public void goForword(){
		x = x +1;
	}
	public void goBackWord(){
		x = x -1;
	}
	public void goLeft(){
		y = y +1;
	}
	public void goRight(){
		y = y -1;
	}
	
	public void showPosition(){
		System.out.println("汽车当前的坐标为：("+x+","+y+")" );
	}
	
	//x,y的封装
	public int getX() {
		return x;
	}
	public int getY() {
		return y;
	}
	public void setX(int x) {
		this.x = x;
	}
	public void setY(int y) {
		this.y = y;
	}
}
